import { createStore, combineReducers, applyMiddleware } from 'redux';
import thunk from 'redux-thunk'
import { CountReducer } from './reducer'
import { ListReducer } from './ListReducer';
// const store = createStore(CountReducer);

// 合并reducer
let reducer = combineReducers({
  'a': CountReducer,
  'b': ListReducer
})
// createStore(reducer, 第二个参数是可选的, 用于设置 state 初始状态或者是异步的库。)
// const store = createStore(reducer);
const store = createStore(reducer, applyMiddleware(thunk));
export default store;